<body id="t">loading...
<script>
function reload() {
  var curr = Date.now()
  try {
    var last = +sessionStorage._ts || 0
    if (curr - last < 100) {
      return setTimeout(reload, 2000)
    }
    sessionStorage._ts = curr
  } catch (err) {
  }
  location.reload()
}

function onfail(err) {
  t.innerHTML = err.message
}


var sw = navigator.serviceWorker
if (!sw || !self.ReadableStream) {
  t.innerHTML = '请使用最新版 Chrome 浏览器访问'
} else {
  sw.getRegistration().then(function(reg) {
    if (reg) {
      reload()
    } else {
      var root = location.href.split('-----')[0]
      sw.register(root + 'x.js')
        .then(reload)
        .catch(onfail)
    }
  })
}
</script>
</body>